from django.shortcuts import render
from .models import Wheel, Nav, Mustbuy,Shop,Mainshop

# Create your views here.

def home(request):

    wheelist = Wheel.objects.all()
    topMenu = Nav.objects.all()
    mustbuylist = Mustbuy.objects.all()

    shoplist = Shop.objects.all()
    shop1 = shoplist[0]
    shop2 = shoplist[1:3]
    shop3 = shoplist[3:7]
    shop4 = shoplist[7:11]

    mainlist = Mainshop.objects.all()

    return render(request, 'axf/home.html',{'title':'首页','wheelist':wheelist, 'topMenu': topMenu, 'mustbuylist':mustbuylist,'shop1':shop1,'shop2':shop2,'shop3':shop3,'shop4':shop4,'mainList':mainlist})


def market(request):
    return render(request, 'axf/market.html',{'title':'超市'})


def cart(request):
    return render(request, 'axf/cart.html', {'title':'购物车'})


def mine(request):
    return render(request, 'axf/mine.html',{'title':'个人中心'})



